Filtering and decompositions ============================= .. index:: filtering Linear filtration --------------------- Filtering with constant parameters can be done efficiently with algorithms presented in e.g. :cite:`DeJongCCL2003`, :cite:`KoopmanDurbin2000`, :cite:`KoopmanDurbin2003`, :cite:`DurbinKoopman2012`. Unfortunately those procedures cannot be used in a regime-switching context. The main references in the economics literature for the filtration of Markov-switching state-space models are :cite:`kim1999state` and :cite:`KimNelson2001`, which combine the Kalman and Hamilton filters. Similar algorithms can be found in the engineering literature. See e.g. :cite:`BarShalomEtAl2001`, :cite:`BarShalomEtAl2004`. RISE uses an extension of the algorithms by :cite:`DurbinKoopman2012` except for the initialization process, which in the case of nonstationarity, hasn't been extended to regime-switching models. In the case of nonstationarity, RISE simply applies an arbitrary variance for the initialization process. Also, for efficiency reasons, RISE deviates from :cite:`KimNelson2001` when it comes to the collapsing of the regimes. While :cite:`KimNelson2001` collapse the updates, RISE collapse the forecasts. The two procedures yield numerically similar results but the procedure in RISE is faster. Historical Decomposition ----------------------------- .. warning:: Exact only for constant-parameter linear models. Observables decomposition ------------------------------- .. important:: Available only for constant-parameter models Conditional forecasting via filtering ----------------------------------------- .. index:: filtering Conditional forecasting can be implemented using filtering algorithms. Suppose we want to condition on a variable X0. Hard conditions ~~~~~~~~~~~~~~~~~~~~~ We simply smooth over an extended sample. Soft conditions ~~~~~~~~~~~~~~~~~~~~~~ We relate X0 to some variable X in the model as :math:`X0_t=X_t+\sigma \varepsilon_t`. And we let :math:`\sigma` control the softness of the condition : - If :math:`\sigma` tends to :math:`\infty` the condition is irrelevant - If :math:`\sigma` tends to 0 we have **hard conditions** - If :math:`\sigma` is greater than 0 but finite (small enough) we have **soft conditions**. User-defined filter --------------------